package com.xiaobingby.admin.sys.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xiaobingby.admin.sys.entity.Permission;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * sys_permission 权限表 Mapper 接口
 * </p>
 *
 * @author XiaoBingBy
 * @since 2018-10-29
 */
public interface PermissionMapper extends BaseMapper<Permission> {

    /**
     * 查询所有菜单权限
     * @param userId
     * @return
     */
    List<Permission> findAllMenus();

    /**
     * 查询所有操作按钮权限
     * @param userId
     * @return
     */
    List<Permission> findAllOperating();

    /**
     * 查询用户所有权限
     * @param userId
     * @return
     */
    List<Permission> findUserMenus(@Param("userId") Long userId);

}
